CHALLENGE #3: This code is super repetitive. Let's use a function to refactor it following these guidelines:

  • Create one function called abduct with Define Function and call it three times.
  • Use only one for-loop INSIDE your function.
  • Your code should do EXACTLY the same thing as the original program.
  • Note: Each person will have to be hidden individually with three separate .hide() commands.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)